home *** CD-ROM | disk | FTP | other *** search
/ SGI O2 Out of Box Experience / SGI O2 Out of Box Experience.iso / cgi-bin / nph-startSysSetup.cgi < prev    next >
Text File  |  1996-11-14  |  6KB  |  160 lines

  1. #!/bin/sh
  2.  
  3. #**************************************************************************
  4. #*                                                                        *
  5. #*            Copyright (c) 1993 Silicon Graphics, Inc.                   *
  6. #*                      All Rights Reserved                               *
  7. #*                                                                        *
  8. #*         THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF SGI             *
  9. #*                                                                        *
  10. #* The copyright notice above does not evidence any actual of intended    *
  11. #* publication of such source code, and is an unpublished work by Silicon *
  12. #* Graphics, Inc. This material contains CONFIDENTIAL INFORMATION that is *
  13. #* the property of Silicon Graphics, Inc. Any use, duplication or         *
  14. #* disclosure not specifically authorized by Silicon Graphics is strictly *
  15. #* prohibited.                                                            *
  16. #*                                                                        *
  17. #* RESTRICTED RIGHTS LEGEND:                                              *
  18. #*                                                                        *
  19. #* Use, duplication or disclosure by the Government is subject to         *
  20. #* restrictions as set forth in subdivision (c)(1)(ii) of the Rights in   *
  21. #* Technical Data and Computer Software clause at DFARS 52.227-7013,      *
  22. #* and/or in similar or successor clauses in the FAR, DOD or NASA FAR     *
  23. #* Supplement. Unpublished - rights reserved under the Copyright Laws of  *
  24. #* the United States. Contractor is SILICON GRAPHICS, INC., 2011 N.       *
  25. #* Shoreline Blvd., Mountain View, CA 94039-7311                          *
  26. #**************************************************************************
  27.  
  28. DISPLAY=:0.0
  29. export DISPLAY
  30.  
  31.  
  32. # First thing, check to see if we've already started System Setup
  33. #    If so, exit.  If not, continue on.......
  34.  
  35. # Note that this is very specific, so if the calling string changes,
  36. #        we must change this conditional as well.
  37. found=`/sbin/ps -ef | grep "/usr/bin/X11/netscape -xrm .netscape.Navigator.form.pane.leftOffset:" | grep -v grep `
  38. if [ -n "$found"  ]; then
  39.     /usr/bin/X11/xconfirm -c -B "OK" -icon progress \
  40.         -font '-*-helvetica-medium-r-narrow--19-*-*-*-p-83-iso8859-1' \
  41.         -t "System Setup has already been started..."  > /dev/null
  42.     exit
  43. fi
  44.  
  45.  
  46.  
  47.  
  48. server_protocol=$SERVER_PROTOCOL;
  49. server_software=$SERVER_SOFTWARE;
  50.  
  51. /sbin/echo "$server_protocol 200 OK"
  52. /sbin/echo "Server: $server_software"
  53. /sbin/echo "Content-Type: text/html\n\n";
  54.  
  55.  
  56. # Print header
  57. /sbin/echo "<html>\n";
  58. /sbin/echo "<body bgcolor=#000000 text=#996688>\n";
  59. /sbin/echo "<PRE>\n";
  60. /sbin/echo "</PRE>\n";
  61. /sbin/echo "<h2>    Starting System Setup...</h2>\n";
  62. /sbin/echo "<P>\n";
  63. /sbin/echo "             <FONT SIZE="3">It may take up to 30 seconds to start this tool.</FONT>\n";
  64. /sbin/echo "<BR>\n";
  65. /sbin/echo "             <FONT SIZE="3">Please be patient.</FONT>\n";
  66. /sbin/echo "</P>\n";
  67. /sbin/echo "</body>\n";
  68. /sbin/echo "</html>\n";
  69.  
  70.  
  71.  
  72. #  Because we are starting from CGI, we need to reset the
  73. #    $HOME so that Netscape can find the preferences file and
  74. #    cache directory.
  75.  
  76. HOME=/tmp/.sset; export HOME
  77. TMPDIR=/tmp; export TMPDIR
  78.  
  79. # create the home directory
  80. if [ ! -d $HOME ]; then
  81.     /sbin/mkdir $HOME
  82. fi
  83.  
  84. # create the .netscape directory
  85. if [ ! -d $HOME/.netscape ]; then
  86.     /sbin/mkdir $HOME/.netscape
  87. fi
  88.  
  89. # create the .netscape/cache directory so we don't get told that it
  90. #    created one for us
  91. if [ ! -d $HOME/.netscape/cache ]; then
  92.     /sbin/mkdir $HOME/.netscape/cache
  93. fi
  94.  
  95. # Get OutOfBox's copy of the System Setup preferences file for us to use
  96. /bin/cp /CDROM/misc/ssetPreferences $HOME/.netscape/preferences
  97. /sbin/chown nobody.nobody $HOME/.netscape/preferences
  98.  
  99. # Get OutOfBox's plugin.list file - this cuts significant time off of startup
  100. #    Use OutOfBox's list becuase it will be current - it was just created...
  101. /bin/cp /usr/people/OutOfBox/.netscape/plugin-list $HOME/.netscape/plugin-list
  102. /sbin/chown nobody.nobody $HOME/.netscape/plugin-list
  103.  
  104.  
  105. # The window size is 696x697, just FYI
  106. #    This is centered placement for a 1280x1024 display size
  107. locn="+292+163"
  108.  
  109.  
  110. # Before the user starts System Setup, get rid of the lock file so
  111. #    that we don't get an error next time we start.  (Netscape only
  112. #    removes the lock when you quit via File->Exit.)
  113. #    The lock is actually a link, so we check for "-l"
  114. if [ -l $HOME/.netscape/lock ]; then    
  115.     /sbin/rm $HOME/.netscape/lock
  116. fi
  117.  
  118.  
  119.  
  120. # Check to be sure that we have the correct Netscape version number
  121. #   in our preferences file; we don't want the customers to see
  122. #   the license agreement window...
  123. /usr/people/OutOfBox/bin/netscapeVsn.pl nobody $HOME
  124.  
  125.  
  126.  
  127.  
  128.  
  129. # Above, the test to see if this app has already been launched depends
  130. #    on this string not changing.  If this calling string *does* change,
  131. #    be sure to change the conditional at the top of the file as well. 
  132.  
  133. # invoke Netscape w/out any menus, buttons, borders, status, etc.....
  134. /usr/bin/X11/netscape \
  135.   -xrm ".netscape.Navigator.form.pane.leftOffset: -5" \
  136.   -xrm ".netscape.Navigator.form.pane.rightOffset: -5" \
  137.   -xrm ".netscape.Navigator.form.pane.bottomOffset: -5" \
  138.   -xrm ".netscape.Navigator.form.menuBar.topOffset: -35" \
  139.   -xrm ".netscape.Navigator.form.dashboard.bottomOffset: -80" \
  140.   -xrm ".netscape.Navigator.form.securityBar.topOffset: -10" \
  141.   -geometry $locn \
  142.   http://localhost/SysSetup/en_US/Base/SysStartup.html
  143.  
  144.  
  145.  
  146. # Print header
  147. /sbin/echo "<html>\n";
  148. /sbin/echo "<body onLoad='self.location=\"file:/CDROM/entryspace/off.html\"'>\n";
  149. /sbin/echo "</body>\n";
  150. /sbin/echo "</html>\n";
  151.  
  152.  
  153.  
  154.  
  155.  
  156. # After the System Setup has quit, clean up the temporary home directory 
  157. if [  -d $HOME ]; then
  158.     /bin/rm -rf $HOME
  159. fi
  160.